package com.hdoit.kylin.web.group.modelconfig;

import com.hdoit.kylin.web.studentManager.providers.StudentOwnProvider;
import com.hdoit.kylin.web.studentManager.providers.TeacherOwnProvider;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      liyaochong
 * @email       
 * @createtime  2017年08月01日 15:37:06
 * @comment
 */
public class TaskConfig extends ModelMetadataAttributeConfiguration{
    public TaskConfig(){

        this.setProperty("publishDate")
            .hasAttribute(new DisplayNameAttribute("发布时间"))
            .hasAttribute(new RequiredAttribute("发布时间为必填项"))
            .hasAttribute(new DateTimeAttribute());

        this.setProperty("finishDate")
            .hasAttribute(new DisplayNameAttribute("截止时间"))
            .hasAttribute(new DateTimeAttribute());

        this.setProperty("comments")
            .hasAttribute(new DisplayNameAttribute("任务描述"));

        this.setProperty("taskName")
            .hasAttribute(new DisplayNameAttribute("任务名称"))
            .hasAttribute(new RequiredAttribute("任务名称为必填项"));
        
        this.setProperty("semester")
        .hasAttribute(new DisplayNameAttribute("学期"))
        .hasAttribute(new RequiredAttribute("学期为必填项"));

        this.setProperty("process")
            .hasAttribute(new DisplayNameAttribute("进度"))
            .hasAttribute(new RequiredAttribute("进度为必填项"));

        this.setProperty("employeeId")
            .hasAttribute(new DisplayNameAttribute("学生姓名"))
            .hasAttribute(new RequiredAttribute("学生姓名为必填项"))
            .hasAttribute(new DropDownListAttribute(new StudentOwnProvider()));
        
        this.setProperty("publisherId")
        		.hasAttribute(new DisplayNameAttribute("导师姓名"))
        		.hasAttribute(new RequiredAttribute("导师姓名为必填项"))
        		.hasAttribute(new DropDownListAttribute(new TeacherOwnProvider()));
    }
}